package com.elloe.数组.有序数组的平方;

import java.util.Arrays;

/**
 * @author ElloeStudy(Sifa Zhang)
 * @create 2022-04-02 19:16
 * To: 真常应物，真常得性，常清常静，常清静矣
 */
public class ViolentSortSquares {
    // 暴力解法

    public static void main(String[] args) {
        int[] nums = {-4,-1,0,3,10};
        for (int i = 0; i < nums.length; i++) {
            nums[i] = nums[i] * nums[i];
        }
        Arrays.sort(nums);
        System.out.println(Arrays.toString(nums));
    }
}
